import { uniqueId } from 'lodash'
import { hideDev } from "@/api/coinType.js";

// 插件
// import demoPlugins from './modules/demo-plugins'
// // 组件
// import demoComponents from './modules/demo-components'
// // 功能
// import demoPlayground from './modules/demo-playground'

/**
 * @description 给菜单数据补充上 path 字段
 * @description https://github.com/d2-projects/d2-admin/issues/209
 * @param {Array} menu 原始的菜单数据
 */
function supplementPath (menu) {
  return menu.map(e => ({
    ...e,
    path: e.path || uniqueId('d2-menu-empty-'),
    ...e.children ? {
      children: supplementPath(e.children)
    } : {}
  }))
}

// 菜单 侧边栏



let arr = [
  {
    path: '/index',
    title: '首页',
    icon: 'menu-1'
  },
  {
    path: '/timbreLibrary',
    title: '创建音色库',
    icon: 'menu-2'
  },
  {
    path: '/voiceClone',
    title: '人声克隆',
    icon: 'menu-3'
  },
  {
    path: '/audioDenoising',
    title: '音频降噪',
    icon: 'menu-4'
  },
  {
    path: '/musicSeparation',
    title: '背景音乐分离',
    icon: 'menu-5'
  },
  {
    path: '/extractingAudio',
    title: '视频提取音频',
    icon: 'menu-6'
  },
  {
    path: '/buyCharacters',
    title: '购买字符',
    icon: 'menu-7'
  },
  {
    path: '/myrecord',
    title: '我的记录',
    icon: 'menu-8'
  },
  {
    path: '/problemFeedback',
    title: '问题反馈',
    icon: 'menu-9'
  },
  {
    path: '/diyContent',
    title: '定制内容',
    icon: 'menu-10'
  },
  // demoComponents,
  // demoPlugins,
  // demoPlayground
]

if(hideDev) arr.splice(3,3)

export const menuAside = supplementPath(arr)

// 菜单 顶栏
export const menuHeader = supplementPath([
  // {
  //   path: '/index',
  //   title: '首页',
  //   icon: 'home'
  // },
  // demoPlayground,
  // demoComponents,
  // demoPlugins
])
